<template>
	<view class="box">
		<view class="title">{{title}}</view>
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index" @tap="goDetail(item)">
				<u--image 
				:showLoading="true" 
				:src="item.goods_thumb" 
				width="200rpx" 
				height="200rpx"
				radius="10rpx"></u--image>
				<view class="info">
					<view class="info_title">{{item.goods_name}}</view>
					<!-- <view class="info_desc">全新一代屏下摄像手机</view> -->
				</view>
				<view class="price-box">
					<text class="money">￥{{item.shop_price}}</text>
					<text class="old-money">{{item.market_price}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			list: {
				type: Array,
				default: []
			}
		},
		methods: {
			goDetail(item) {
				this.$emit('detail',item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		// padding-top: 20rpx;
		// padding-bottom: 20rpx;
		.title {
			font-size: 32rpx;
			color: #333333;
			padding: 20rpx 0;
		}
		.list {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			.item {
				width: 350rpx;
				height: 500rpx;
				background-color: #ffffff;
				border-radius: 20rpx;
				padding: 30rpx 20rpx;
				box-sizing: border-box;
				margin-bottom: 10rpx;
				display: flex;
				align-items: center;
				flex-direction: column;
				justify-content: space-between;
				.info {
					width: 100%;
					&_title {
						font-size: 28rpx;
						color: #333333;
					}
					&_desc {
						font-size: 24rpx;
						color: #999999;
						margin-top: 10rpx;
					}
				}
				.price-box {
					width: 100%;
					.money {
						font-size: 32rpx;
						color: #E81526;
						font-weight: 700;
					}
					.old-money {
						font-size: 24rpx;
						color: #999999;
						text-decoration: line-through;
						margin-left: 10rpx;
					}
				}
			}
		}
	}
</style>